<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <title>{{$chubaninfos[0]->danwei_name}}-夜读书</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="author" content="夜读书">
    <meta name="description" content="加入夜读书文化联盟，共同打造文化的产业盟国，让阅读无处不在。">
    <meta name="keywords" content="夜读书文化联盟，读书,阅读,小说,文学">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="{{ asset('/bootstrap-3.3.5-dist/css/bootstrap.min.css') }}">
    <link rel="stylesheet" href="{{ asset('/style/css/hangye.css') }}">
    <script src="{{ asset('/scripts/jquery/jquery-1.11.3.min.js') }}"></script>
    <script src="{{ asset('/bootstrap-3.3.5-dist/js/bootstrap.min.js') }}"></script>
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=tSpywWbTNWDtUHVpM0hmr2ZHYL7MRsc2"></script>
</head>
<body onload="theLocation();">
    @include('hangye.include.header')
    <div id="detail">
        <div class="site-wrapper">
            <div class="info-header">
                <div class="title">{{$chubaninfos[0]->danwei_name}}</div>
            </div>
            <div class="info-display">
                <div class="img-detail">
                    <img src="{{url($chubaninfos[0]->huanjing1)}}" />
                </div>
                <div class="pull-right">
                    <div class="other-detail">
                        <div class="other-detail-line1-level">
                            <span class="other-detail-line1-score">10</span>分                            
                        </div>
                        <div class="openComment">查看0条评价</div>
                    </div>
                </div>
            </div>
            <div class="info-box">
                <div class="nav-tabs">
                    <li class="current">内容介绍</li>
                </div>
                <div class="neirong bor-bottom">
                    <dt class="">电话:</dt>
                    <dd>{{$chubaninfos[0]->dianhua}}</dd>
                </div>
                <div class="neirong bor-bottom">
                    <dt class="">地址:</dt>
                    <dd>{{$chubaninfos[0]->dizhi}}</dd>
                </div>
                <div class="neirong @if($chubaninfos[0]->web_url!="") bor-bottom @endif">
                    <dt class="">介绍:</dt>
                    <dd>{!!$chubaninfos[0]->jieshao!!}</dd>
                </div>
                @if($chubaninfos[0]->web_url!="")
                <div class="neirong">
                    <dt class="">网址:</dt>
                    <dd><a href="http://{{$chubaninfos[0]->web_url}}" target="_blank">{{$chubaninfos[0]->web_url}}</a></dd>
                </div>
                @endif
            </div>
            <div class="info-box">
                <div class="nav-tabs">
                    <li class="current">交通位置</li>
                </div>
                <div class="map" style="padding-top:5px;width: 100%;height: 500px;">
                    <!-- 百度地图 -->
                    <div id="r-result"></div>
                    <div id="allmap" style="height:500px;"></div>                    
                </div>
            </div>
            <!-- <div class="info-box">
                <div class="nav-tabs">
                    <li class="current">点评</li>
                </div>                
                <div class="rate-header">
                    <span class="rate-score">整体评分：<em class="score-color">4.5</em></span>
                </div>
                <div class="ratelist-content">
                    <div class="booksbox">
                        <img class="bimg" style="float:left;" src="https://img.meituan.net/50.50/avatar/be6a973cadb3677f2456ab9fcb7d8038323393.jpeg" />
                        <div style="margin-left: 90px;">
                            <p style="padding-top: 10px;">文字介绍</p>
                            <p>评分</p>
                        </div>
                        <div style="clear:both"></div>
                    </div>
                </div>
                <div class="paginator-wrapper">1,2,3</div>
            </div> -->
            <div class="" style="padding-bottom: 10px"></div>
        </div>
    </div>
    
    @include('hangye.include.footer')
</body>
</html>

<script type="text/javascript">
    // 百度地图API功能
    var map = new BMap.Map("allmap"); //创建Map实例
    var point = new BMap.Point(116.331398,39.897445);
    map.centerAndZoom(point,16); //设初始化地图
    map.enableScrollWheelZoom(true);   //开启鼠标滚轮缩放

    //添加地图类型控件
    map.addControl(new BMap.MapTypeControl({
        mapTypes:[
            BMAP_NORMAL_MAP,
            BMAP_HYBRID_MAP
        ]
    }));

    //map.centerAndZoom(new BMap.Point(116.404, 39.915), 11);
    // 添加带有定位的导航控件
    var navigationControl = new BMap.NavigationControl({
        // 靠左上角位置
        anchor: BMAP_ANCHOR_TOP_LEFT,
        // LARGE类型
        type: BMAP_NAVIGATION_CONTROL_LARGE,
        // 启用显示定位
        enableGeolocation: true
    });
    map.addControl(navigationControl);

    // 用经纬度设置地图中心点(根据经纬度定位)
    function theLocation(){
        map.clearOverlays(); 
        var new_point = new BMap.Point({{$chubaninfos[0]->x_lng}},{{$chubaninfos[0]->y_lat}});
        var marker = new BMap.Marker(new_point);  // 创建标注
        map.addOverlay(marker); // 将标注添加到地图中
        map.panTo(new_point);

        var sContent ="{{$chubaninfos[0]->danwei_name}}<br/>{{$chubaninfos[0]->dizhi}}";
        var infoWindow = new BMap.InfoWindow(sContent);  // 创建信息窗口对象
        map.openInfoWindow(infoWindow,new_point); //开启信息窗口
    }
    //点击显示窗口信息
    marker.addEventListener("click", function(){          
        map.openInfoWindow(infoWindow,new_point); //开启信息窗口
    });
</script>
